package com.practice.string;

public class ReverseString {
	public String reverse(String string) {
		return new StringBuffer(string).reverse().toString();
	}
	
	public String reverse2(String string) {
		char[] c = string.toCharArray();
		for (int i=0; i<c.length/2; i++) {
			char t = c[i];
			c[i] = c[c.length - i - 1];
			c[c.length - i - 1] = t;
		}
		return new String(c);
	}
}
